from page.app_page_pay import PagePay
from page.app_page_search import PageSearch
from page.app_page_shopping_cart import PageSpCart
from script import log


class TestAppPay:

    def test01_pay_success(self, driver, login):
        PageSearch(driver).page_search("灵刃")
        PageSpCart(driver).page_sp_cart()
        PagePay(driver).page_pay()
        result = PagePay(driver).get_pay_success()
        print(f"支付结果为：{result}")
        log.info(f"支付结果为：{result}")
        assert "确认订单成功" == result
        PagePay(driver).app_shot("pay_success")
